package com.aspose.cells;

import java.util.ArrayList;
import java.util.List;

final class zawb {
   static ArrayList a(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, int var3) throws Exception {
      zif var4 = var1.v();
      int var5 = var1.af();
      int[] var6 = new int[]{57, 58, 59};
      zbo var7;
      zbo var8;
      if (var5 == 1) {
         var8 = var4.e();
         var7 = var4.E();
      } else {
         var8 = var4.g();
         var7 = var4.G();
      }

      double var9 = var7.n() ? zbuk.e(var7.z()) : var7.z();
      double var11 = var7.n() ? zbuk.e(var7.D()) : var7.D();
      zbcr var13 = var4.z();
      int var14 = var13.getCount();
      ArrayList var15 = new ArrayList();
      double var16 = (double)var2.c() + (double)var2.e() / 2.0D;
      double var18 = (double)var2.d() + (double)var2.f() / 2.0D;
      double var20 = (double)(var2.e() / 2);
      double var22 = 6.283185307179586D / (double)var3;
      int var24 = var1.ai();
      com.aspose.cells.b.a.b.zm var25 = null;
      ArrayList var26 = new ArrayList();
      ArrayList var27 = new ArrayList();
      zjf var28 = var1.D();
      double var29 = 1.5707963267948966D;

      for(int var31 = 0; var31 < var3; ++var31) {
         zjd var32 = var28.b(var31);
         double var33;
         double var35;
         double var37;
         double var39;
         com.aspose.cells.b.a.b.zo var41;
         if (var32 != null && !var32.a() && !var32.H()) {
            if (var25 != null) {
               var25.a();
            }

            var25 = zama.a(var32.k());
            var33 = Math.abs(var32.v() - var11);
            var35 = var20 * var33 / (var9 - var11);
            var37 = var16 + var35 * Math.cos(var29);
            var39 = var18 - var35 * Math.sin(var29);
            var41 = new com.aspose.cells.b.a.b.zo((float)var37, (float)var39);
            com.aspose.cells.b.a.a.ze.a(var26, (Object)var41);
            com.aspose.cells.b.a.a.ze.a(var27, (Object)var41);
            zalc.a(var0, (float)var37, (float)var39, var1.B(), (float)var1.B().c(), false);
            zpt var42 = var32.o();
            com.aspose.cells.b.a.b.zt var43 = zpv.a(var0, var8, var13, var24, var31, (int)var20);
            double var44 = var35 + (double)(var43.b() / 2.0F) + (double)(var43.c() / 2.0F);
            double var46 = var16 + var44 * Math.cos(var29);
            double var48 = var18 - var44 * Math.sin(var29);
            Object[] var50 = new Object[]{var24, var31, new com.aspose.cells.b.a.b.zo((float)var46, (float)var48), var8, var20};
            com.aspose.cells.b.a.a.ze.a(var15, (Object)var50);
         } else {
            com.aspose.cells.b.a.a.ze.a(var26, (Object)null);
            com.aspose.cells.b.a.a.ze.a(var27, (Object)(new com.aspose.cells.b.a.b.zo((float)var16, (float)var18)));
         }

         if (var31 == var3 - 1) {
            var32 = var28.b(0);
            if (var32 != null && !var32.a()) {
               var33 = Math.abs(var32.v() - var11);
               var35 = var20 * var33 / (var9 - var11);
               var37 = var16 + var35 * Math.cos(1.5707963267948966D);
               var39 = var18 - var35 * Math.sin(1.5707963267948966D);
               var41 = new com.aspose.cells.b.a.b.zo((float)var37, (float)var39);
               com.aspose.cells.b.a.a.ze.a(var26, (Object)var41);
            } else {
               com.aspose.cells.b.a.a.ze.a(var26, (Object)null);
            }
         }

         var29 -= var22;
      }

      if (var1.ag() != 59) {
         if (var25 == null) {
            var25 = zama.a(var1.z());
         }

         zkq.a((zn)var0, (zbcp)var1, (List)var26, (com.aspose.cells.b.a.b.zm)var25, (com.aspose.cells.b.a.b.zp)var2);
      } else {
         a(var0, (List)var27, (zbcp)var1);
      }

      if (var25 != null) {
         var25.a();
      }

      return var15;
   }

   static void a(zn var0, zif var1, ArrayList var2) throws Exception {
      for(int var3 = 0; var3 < var2.size(); ++var3) {
         Object[] var4 = (Object[])((Object[])var2.get(var3));
         int var5 = (Integer)var4[0];
         int var6 = (Integer)var4[1];
         com.aspose.cells.b.a.b.zo var7 = (com.aspose.cells.b.a.b.zo)var4[2];
         zbo var8 = (zbo)var4[3];
         int var9 = com.aspose.cells.b.a.ze.f(var4[4]);
         zkq.a(var0, var8, var5, var6, var7, var9);
      }

   }

   private static void a(zn var0, List var1, zbcp var2) {
      com.aspose.cells.b.a.b.zo[] var3 = new com.aspose.cells.b.a.b.zo[var1.size()];
      zbuk.a(var3);

      for(int var4 = 0; var4 < var1.size(); ++var4) {
         com.aspose.cells.b.a.b.zo var5 = (com.aspose.cells.b.a.b.zo)var1.get(var4);
         var3[var4] = var5;
      }

      com.aspose.cells.b.a.b.zq var10 = zau.a(var3);
      com.aspose.cells.b.a.b.zc var9 = zax.a(var2.A(), var10);

      try {
         var0.a(var9, var3);
      } finally {
         if (var9 != null) {
            var9.f();
         }

      }

      var0.c(zama.a(var2.z()), var3);
   }
}
